import styled from 'styled-components'
import logoPic from '../../static/logo.png'

export const HeaderWrapper = styled.div`
  position: relative;
  height: 56px;
  border: 1px solid #f0f0f0;
  margin-bottom: 1px;
`
export const Logo = styled.a`
  position: absolute;
  display: block;
  left: 0;
  top: 0;
  width: 100px;
  height: 100%;
  background: url(${logoPic});
  background-size: contain;
`

export const Nav = styled.div`
  width: 960px;
  height: 100%;
  margin: 0 auto;
  padding-right: 90px;
  box-sizing: border-box;
`
export const NavItem = styled.div`
  height: 56px;
  line-height: 56px;
  font-size: 16px;
  padding: 0 15px;
  color: #333;
  cursor: pointer;
  &.left {
    float: left;
  }
  &.right {
    float: right;
    color: #969696;
  }
  &.active {
    color: #ea6f5a;
  }
`

export const SearchWrapper = styled.div`
  float: left;
  position: relative;
  .slide-enter {
    transition: 0.2s all ease-out;
  }
  .slide-enter-active {
    width: 260px;
  }
  .slide-exit {
    transition: 0.2s all ease-out;
  }
  .slide-exit-active {
    width: 160px;
  }
  .zoom {
    position: absolute;
    right: 4px;
    line-height: 30px;
    width: 30px;
    border-radius: 50%;
    bottom: 4px;
    text-align: center;
    color: #969696;
    &.active {
      background: #777;
      color: #fff;
    }
  }
`
export const SearchInfo = styled.div`
  position: absolute;
  left: 20px;
  top: 56px;
  width: 260px;
  box-sizing: border-box;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
  background: #fff;
  padding: 20px 15px 15px;
`
export const SearchTitle = styled.div`
  font-size: 14px;
  margin-bottom: 15px;
  color: #969696;
`
export const SearchChange = styled.span`
  float: right;
  cursor: pointer;
  .spin {
    display: block;
    float: left;
    font-size: 12px;
    margin-right: 4px;
    transition: 0.2s all ease-in;
  }
`
export const SearchList = styled.div`
  overflow: hidden;
`
export const SearchItem = styled.a`
  float: left;
  padding: 2px 6px;
  font-size: 12px;
  color: #787878;
  margin: 0 10px 10px 0;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
  &:hover {
    color: #121212;
    border: 1px solid #ccc;
  }
`

export const NavSearch = styled.input.attrs({
  placeholder: '搜索'
})`
  width: 160px;
  height: 38px;
  margin-top: 9px;
  margin-left: 20px;
  background: #eee;
  border: none;
  border-radius: 40px;
  outline: none;
  padding: 0 40px 0 20px;
  box-sizing: border-box;
  font-size: 14px;
  &::placeholder {
    color: #999;
  }
  &.active {
    width: 260px;
  }
`

export const Addition = styled.div`
  position: absolute;
  right: 30px;
  top: 0px;
  height: 100%;
`
export const Button = styled.div`
  float: right;
  line-height: 38px;
  margin-top: 9px;
  border-radius: 20px;
  border: 1px solid #ea6f5a;
  padding: 0 20px;
  margin-right: 10px;
  &.reg {
    color: #ea6f5a;
    margin-right: 20px;
  }
  &.writing {
    color: #fff;
    background: #ea6f5a;
  }
`
